<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
<title>类名选择器的示例</title>
<style type="text/css">
	div{
		border:1px solid #003a75;
		background-color:#cef;
		margin:5px; 
		height:35px; 
		width:75px;
		float:left;
		font-size:12px;
		padding:5px;
   }
</style>
<script type="text/javascript" src="JS/jquery-3.5.1.min.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		var myClass = $(".myClass");  			 	//选取Dom元素
		myClass.css("background-color","#C50210");	//为选取的Dom元素设置背景颜色
		myClass.css("color","#FFF");				//为选取的Dom元素设置文字颜色
	});
</script>

</head>

<body>
<div class="myClass">注意观察我的样式</div>
<div>我的样式是默认的</div>
</body>
</html>
